import java.util.Scanner;

//DNA序列
public class TestDNA {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        String str = sc.next();
        char[] arr = str.toCharArray();
        //char[] arr = sc.next().toCharArray();
        int right = 0,left = 0,n = arr.length;
        int begin = 0;
        int count = 0;
        int maxCount = 0;
        while(right < n) {
            if (arr[right] == 'C' || arr[right] == 'G') {
                count++;
            }

            while(right - left + 1 > x) {
                if (arr[left] == 'C' || arr[left] == 'G') {
                    count--;
                }
                left++;
            }
               if(right - left + 1 == x) {
                   if(count > maxCount) {
                       begin = left;
                       maxCount = count;
                   }
               }
              right++;
            }
        for (int i = begin; i < begin + x; i++) {
            System.out.println(arr[i]);
        }
    }

}

